﻿using WatiN.Core;

namespace Catchbase.Web.ATest.Pages.Other
{
    public class GoogleOpenId
    {
        private readonly Browser _browser;

        public GoogleOpenId(Browser browser)
        {
            _browser = browser;
        }

        public bool IsActive
        {
            get { return _browser.Url.StartsWith("https://accounts.google.com/o/openid2/auth"); }
        }

        public void Accept()
        {
            var button = _browser.Button("approve_button");
            if (button.Exists) button.Click();
        }
    }
}